<?php for ($i = 0; $i < count($comment); $i++): ?>
    <div class=comment-thread>
        <?php if (isset($comment[$i]['avatar'])) { ?>    
            <img src="<?php echo getAvatarLink($comment[$i]['user_id'], $comment[$i]['avatar']); ?> ">
        <?php } ?>
        <div class="block-left">
            <a class=comment-thread-displayname href="#"><?php echo $comment[$i]['real_name']; ?></a>
            <span><?php echo date("Y/m/d H:i:s", strtotime($comment[$i]['commented_time'])); ?></span>
            <br />
            <div class=comment><?php echo nl2br(htmlspecialchars(urldecode($comment[$i]['comment']))); ?></div>
        </div>
    </div>
<?php endfor; ?>